package LinkedList_03.Loop_LinkedList_05_Joseph;

/*
 * @Author 罗
 * @date 2020/3/12 - 9:57 下午
 *
 */

import org.junit.Test;

public class test_01 {

    @Test
    public void test(){
        SingleLinkedList<Child> singleLinkedList = new SingleLinkedList<>();

        singleLinkedList.addNodes(20);

        singleLinkedList.show();

        System.out.println("获取指定小朋友\t"+singleLinkedList.getSize());

        singleLinkedList.getInterval(1,2,singleLinkedList.getSize());

        /*
            因为节点每取出一个链表长度都会减少，所以不能这样遍历
        for (int i = 0; i < 4; i++) {
            System.out.println("节点每取出一个都会减少"+singleLinkedList.getSize());
            System.out.println(singleLinkedList.getInterval(1,1,1));
        }*/


        /*singleLinkedList.addToLoop(new Child(6,"阿笨"));
        singleLinkedList.addToLoop(new Child(7,"匆匆忙忙"));
        singleLinkedList.addToLoop(new Child(8,"脱裤子"));
        singleLinkedList.addToLoop(new Child(9,"学习"));
        singleLinkedList.addToLoop(new Child(10,"乌拉"));
        System.out.println("将新添加的链表遍历");
        singleLinkedList.show();

        System.out.println("重新添加后，再取出");
        for (int i = 0; i < singleLinkedList.getSize(); i++) {
            System.out.println(singleLinkedList.getInterval(2));
        }
*/
    }
}
